package com.qf.dblib.dao.impl;


import com.qf.dblib.dao.entity.GroupChatBean;

import org.litepal.LitePal;

/**
 * 群组
 * 2020/4/1 17:37
 */
public class GroupDao {
    private static volatile GroupDao instance = null;

    private GroupDao() {

    }

    public static GroupDao getInstance() {
        if (instance == null) {
            synchronized (GroupDao.class) {
                if (instance == null) {
                    instance = new GroupDao();
                }
            }
        }
        return instance;
    }

    public void save(GroupChatBean bean) {
        bean.save();
    }

    public GroupChatBean findLast(String uid, String groupID) {
        return LitePal.where("uid = ? and groupID = ?", uid, groupID).findLast(GroupChatBean.class);
    }


}
